package com.shigu.mo.bo;

import com.yeepay.skb.util.SignUtil;
import org.apache.commons.httpclient.methods.multipart.Part;

import java.io.IOException;
import java.util.List;

public abstract class YeepayCallbackBO {
    private String code;
    private String message;

    abstract Part[] generateParams();
    abstract String getHmac();
    abstract List<String> needHmacArr();

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public boolean checkSafe() throws IOException {
        return getHmac().equals(SignUtil.signHmac(generateParams(),needHmacArr()));
    }


}
